package Stream;

import java.util.*;
import java.util.stream.Stream;

/**
 * @author chihb
 * @create-time 2024/7/9 4:55
 * @description
 */
public class Test {
    public static void main(String[] args) {
        System.out.println("========单列集合获取数据========");
        ArrayList<String> list=new ArrayList<>();
        Collections.addAll(list,"a","b","c","d","e");
        list.forEach(System.out::println);
        System.out.println("========双列集合获取数据========");
        Map<String,Integer> map=new HashMap<>();
        map.put("aaa",1);
        map.put("bbb",2);
        map.put("ccc",3);
        map.put("ddd",4);
        map.put("eee",5);
        map.put("fff",6);
        map.forEach((k,v)-> System.out.println(k+"=====>"+v));
        System.out.println("========数组获取数据========");
        int[] arr={1,2,8,6,7,5,8,5,6,55};
        Arrays.stream(arr).forEach(System.out::println);
        System.out.println("========零散数据获取数据========");
        Stream.of(1,9,8,5,6,8,6,4,38,4,5).forEach(System.out::println);
    }
}
